// 当前文件中封装了所有关于管理员页面的请求
import axios from "@/http";


//请求权限列表
export function adminlist(data) {
  return axios({
    url: "/rights/" + data.type,
    method: "get",
  });
}
//请求角色列表
export function powerlist() {
  return axios({
    url: '/roles',
    method:'get'
  })
}
//删除角色
export function delpower(data){
  return axios({
    url:'roles/'+data.id,
    method:'delete',

  })
}
//添加角色
export function addprower(data){
  return axios({
    url:'/roles',
    method:'post',
    data:data
  })
}

//角色编辑
export function powerchange(data){
  return axios({
    url:'/roles/'+data.id,
    method:'put',
    data: data
  })
}